import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNextInt()){
            int size = in.nextInt();
            int[] score = new int[size];
            for (int i = 0; i < size; i++) {
                score[i] = in.nextInt();
            }
            Arrays.sort(score);
            for (int i = size-1; i > size-6; i--) {
                System.out.print(score[i] + " ");
            }
        }
    }
}
